// 变量类型检查
let myName = 'Packt';
myName = 10;

// 变量类型推断
let favoritelanguage: string;
let langs = ['javaScript', 'Ruby', 'Python']
favoritelanguage = langs[0]

// 接口
interface Person {
    name: string;
    age: number;
}

function printName(person: Person){
    console.log(person.name);
}

const john = { name: 'John', age: 21 };
const mary = { name: 'Mary', age: 21, phone: '123-4578'};
printName(john)
printName(mary)


